<!DOCTYPE html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>编辑版块链接 - 版块网站导航设置  - 后台管理</title>
	<link rel="shortcut icon" type="image/ico" href="/images/favicon.ico">
	<link href="/css/admin/style.css" rel="stylesheet" type="text/css" />
	<link href="/css/validator.css" rel="stylesheet" type="text/css" />
	<script src="/js/jquery-1.4.4.js" type="text/javascript" charset="UTF-8"></script>
	<script src="/js/formValidator-4.1.1.js" type="text/javascript" charset="UTF-8"></script>
	<script src="/js/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
	<script type="text/javascript" src="/js/admin.js"></script>
	
	<script>
	$(document).ready(function(){
		$.formValidator.initConfig({formID:"form1",autoTip:true,tidyMode:true,onError:function(msg){}});
		
	    $("#siteName").formValidator({onShow:"请输入链接名称",onFocus:"至少2个字符",onCorrect:"输入正确"}).inputValidator({min:2,max:200,onError:"输入不合法，请确认"});
	    $("#url").formValidator({onShow:"请输入url",onFocus:"5-250个字符",onCorrect:"输入正确"}).inputValidator({min:2,max:250,onError:"输入不合法，请确认"});
	    $("#itemID").formValidator({onShow:"请选择栏目",onFocus:"栏目必须指定",onCorrect:"输入正确"}).inputValidator({min:1,max:10000,onError:"请选择栏目"});
	    $("#sort").formValidator({empty:true,onShow:"请输入排序",onFocus:"至少1个字符",onCorrect:"输入正确"}).inputValidator({min:1,max:10,onError:"输入不合法，请确认2-10"});
	    
	});
	
	function checkForm(){
		var itemID = $("#itemID");
		var value =itemID.val();
		if(value==null || value==""){
			alert("尚未选择栏目");return false;
		}
		return true;
	}
	</script>
</head>

<body>
	
		<#include "/admin/nav.ftl">
		
		<div id="wrapper">
			<div id="nav_trail"><a href="/admin/">后台首页</a> <a href="index">版块链接管理</a> 增加版块链接</div>
			<div id="content">
			
				<!-- 左边菜单 -->
				<#include "/admin/left_menu.ftl">
				<!-- 左边菜单 -->
				
				<script>
					menusel('m_itemLink');
				</script>
	
	
				<div class="right_area">
					<div class="cbar">
			            
			              <ul>
			                <li ><a href="/admin/item/site/index">链接列表</a></li>
			    			<li class="cbar-tag-sel">增加链接</li>
			              </ul>
			         </div><!-- cbar end -->
			         
			         <div class="cbox">
          
            <div class="ydbar">
      			<div class="info-title">增加链接</div>
    		</div>	
       		
       		<form id="form1" name="form1" method="post" action="update" onSubmit="return checkForm();">
       			<input type="hidden" name="id" value="${itemSite.id}"/>
		    <table cellspacing="0" cellpadding="0" border="0" class="table-f">
		      <tbody>

		      <tr>
		        <td align="right" width="15%" class="formtdl">链接名称：</td>
		        <td align="left" colspan="3"><input type="text" id="siteName" size="30" name="siteName" value="${itemSite.siteName?default("")}" class="fl">
		        <div id="siteNameTip" class="onShow tips" style="width:200px;">请输入链接名称</div></td>
		      </tr>
		      <tr>
		        <td align="right" width="15%" class="formtdl">URL：</td>
		        <td align="left" colspan="3"><input type="text" id="url" size="70" name="url" class="fl" value="${itemSite.url?default("")}" >
		        <div id="urlTip" class="onShow tips" style="width:200px;">请输入URL</div></td>
		      </tr>
		      <tr>
		        <td align="right" width="15%" class="formtdl">所属版块：${itemSite.itemID}</td>
		        <td align="left" colspan="3"><select name="itemID" id="itemID" class="fl" autocomplete="off">
		        			<option value="-1">请选择</option>
		        	<#if itemList?exists>
		        		<#list itemList as item>
		        			<option value="${item.id}" <#if itemSite.itemID==item.id> selected="selected" </#if> >${item.name?default("")}</option>
		        		</#list>
		        	</#if>
		        	</select><div id="itemIDTip" class="onShow tips" style="width:200px;">请选择栏目</div>
		        </td>
		      </tr>
		      <tr>
		        <td align="right" width="15%" class="formtdl">排序：<br/>（大排在前）</td>
		        <td align="left" colspan="3"><input type="text" id="sort" size="10" name="sort" class="fl" value="${itemSite.sort?default("")}" >
		        <div id="sortTip" class="onShow tips" style="width:200px;">排序号大排在前面</div></td>
		      </tr>
		     		     
		    </tbody></table>
		    
    
		    <table width="100%" cellspacing="0" cellpadding="0" border="0">
		      <tbody><tr>
		          <td align="center">
		            <input type="submit" value="提交" id="button" class="inp-yd" name="button">
		            
		        </td></tr>
		    </tbody></table>
		  </form>
             
          </div><!-- cbox end -->
            
			            
			        </div><!-- right_area end -->
				</div>
				
				<div class="clear"></div>
			</div> <!-- content end-->
			<div id="footer"></div>
   		</div><!-- wrapper end-->
</body>
</html>